package cn.kgc.springbootdemo.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;


@Data
@ApiModel("修改账号密码表单对象")
public class UpdateUserForm {

    /**
     *  用户账号
     */
    @NotBlank(message = "用户账号不能为空")
    @ApiModelProperty(value = "用户账号",name = "userCode",required = true)
    private String userCode;

    /**
     * 用户原始密码
     */
    @NotBlank(message = "原始密码不能为空")
    @ApiModelProperty(value = "原始密码",name = "password",required = true)
    private String password;

    /**
     * 新密码
     */
    @NotBlank(message = "新密码不能为空")
    @Size(min = 6,max = 32,message = "长度必须大于等于6小于32位")
    @Pattern(regexp = "[0-9]+[a-zA-Z]+[0-9a-zA-Z]*|[a-zA-Z]+[0-9]+[0-9a-zA-Z]*",message = "密码必须包含字母加数字")
    @ApiModelProperty(value = "新密码",name = "newPassword",required = true)
    private String newPassword;



    @NotBlank(message = "确认新密码不能为空")
    @Size(min = 6,max = 32,message = "长度必须大于等于6小于32位")
    @Pattern(regexp = "[0-9]+[a-zA-Z]+[0-9a-zA-Z]*|[a-zA-Z]+[0-9]+[0-9a-zA-Z]*$",message = "密码必须包含字母加数字")
    @ApiModelProperty(value = "确认新密码",required = true)
    private String newPasswordVerify;
}
